package com.monitoreo.mdb;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * Message-Driven Bean implementation class for: ProcesarArticuloBean
 */
@MessageDriven(
		activationConfig = { 
				@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
				@ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/monitoreo")
				},
		mappedName = "jms/queue/monitoreo")
public class LogAuditoria implements MessageListener {
	
    public LogAuditoria() {
        // TODO Auto-generated constructor stub
    }
	
	/**
     * @see MessageListener#onMessage(Message)
     */
    public void onMessage(Message message) {
        // TODO Auto-generated method stub
    	
    	String xml = null;
    	
    	if (message instanceof TextMessage) {
    		
    		
    		try {
    		
    			xml = ((TextMessage) message).getText();
    		
    			System.out.println(xml);
    			
    			
							
			}  catch(Exception e){
			
				
				
			}
    	}
    }

}
